package matrix;

public class IdentityMatrix implements SquareMatrix<Integer>, ImmutableMatrix {

	final private int n;
	final Dimension d;
	
	public IdentityMatrix(int n){
		this.n = n;
		d = new Dimension(n, n);
	}
	
	@Override
	public final Integer get(int i, int j) {
		return i==j ? 1 : 0;
	}

	@Override
	public final Dimension getDim() {
		return d;
	}

	@Override
	public final int getSize() {
		return n;
	}

}
